﻿@model IList<ProductSpecificationModel>
@using SDF.Web.Models.Catalog;
@if (Model.Count > 0)
{
    <div class="product-specs-box">
        <div class="title">
            <strong>@T("Products.Specs")</strong>
        </div>
        <div class="table-wrapper">
            <table class="data-table">
                <colgroup>
                    <col width="25%" />
                    <col />
                </colgroup>
                <tbody>
                    @for (int i = 0; i < Model.Count; i++)
                    {
                        var item = Model[i];
                        <tr @(i % 2 == 0 ? Html.Raw(" class=\"odd\"") : Html.Raw(" class=\"even\""))>
                            <td class="spec-name">
                                @item.SpecificationAttributeName
                            </td>
                            <td class="spec-value">
                                @if (String.IsNullOrEmpty(item.ColorSquaresRgb))
                                {
                                    @Html.Raw(item.ValueRaw)
                                }
                                else
                                {
                                    <div class="color-squares">
                                        <span class="color-container" title="@Html.Raw(item.ValueRaw)">
                                            <span class="color" style="background-color: @(item.ColorSquaresRgb);">&nbsp;</span>
                                        </span>
                                    </div>
                                }
                            </td>
                        </tr>
                    }
                </tbody>
            </table>
        </div>
    </div>
}